#ifndef __dhs_encdec
#define __dhs_encdec

#include <openssl/aes.h>
#include <openssl/sha.h>
#include <openssl/rsa.h>
#include <openssl/pem.h>
#include <openssl/err.h>
#include <openssl/bio.h>


void aes_encrypt(const char * key, const unsigned char * srcdata,size_t src_len, unsigned char * result);
void aes_decrypt(const char * key, const unsigned char * srcdata,size_t src_len, unsigned char * result);

static size_t getAES_enc_result_len(size_t src_len);

/**
 * @return 签名长度;
*/
int   rsa_sha256_sign(const unsigned char * srcdata, size_t src_len, unsigned char ** result);

/**
 * @return  1-success;0- fail
 * @param src_len 签名长度 ;srcdata 签名数据;siglen 签名长度 ;sigbuf 签名数据 ;
*/
int   rsa_sha256_verify(const unsigned char * srcdata, size_t src_len, unsigned char * sigbuf,int siglen);

/**
 * 加载私钥
*/
RSA * loadPriveteKey(const char * private_key_path,const char * password);
/**
 * 加载公钥
*/
RSA * loadPublickey();

#endif